//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package org.come.Jpanel;

import com.tool.tcpimg.UIUtils;
import org.come.until.CutButtonImage;

import javax.swing.*;
import java.awt.*;
import java.awt.image.ImageObserver;
import java.util.Map;

class MyRendererPH extends JPanel implements ListCellRenderer {
    private int index;
    public static String vs;
    private Object value;
    private Map<String, Integer> map;
    private boolean isSelected;
    private static DefaultListModel<String> listModel;
    private ImageIcon mountBox;

    public MyRendererPH() {
    }

    public MyRendererPH(int index, Object value, boolean isSelected) {
        this.index = index;
        this.isSelected = isSelected;
        this.value = value;
    }

    public Dimension getPreferredSize() {
        return new Dimension(this.getWidth(), 40);
    }

    public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
        MyRendererPH mr = new MyRendererPH(index, value, isSelected);
        mr.removeAll();
        mr.setOpaque(false);
        mr.setLayout(new FlowLayout(0));
        Box box = Box.createHorizontalBox();
        mr.add(box);
        return mr;
    }

    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        Graphics2D g2d = (Graphics2D)g;
        if (this.mountBox == null) {
            this.mountBox = new ImageIcon("inkImg/background/phxz.png");
        }

        if (this.isSelected) {
            g.drawImage(this.mountBox.getImage(), -2, 1, 125, 35, (ImageObserver)null);
        }

        ImageIcon image = CutButtonImage.getImage("inkImg/background/ph/" + (Math.min(this.index, 4)) + ".png", 24, 22);
        g.drawImage(image.getImage(), 0, 6, 26, 24, (ImageObserver)null);
        g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
        g2d.setComposite(AlphaComposite.getInstance(3, 0.6F));
        g2d.setFont(UIUtils.TEXT_HY19);
        g2d.drawString(this.value + "", 10, 23);
        g2d.drawString(this.value + "", 10, 23);
        g2d.drawString(this.value + "", 9, 23);
    }
}
